﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WebsiteClient.ApiControllers;

namespace TestProject
{
    [TestClass]
    public class AccountEmail
    {
        [TestMethod]
        public void EmailAlreadyInUse()
        {
            // New instance of controller.
            UserController userCtr = new UserController();

            // The email test@mail.dk is already in use.
            string email = "test@mail.dk";

            bool isAvailable = userCtr.IsEmailAvailable(email);

            Assert.IsFalse(isAvailable, "Email is already in use");
        }

        [TestMethod]
        public void EmailIsNotInUse()
        {
            // New instance of controller.
            UserController userCtr = new UserController();

            // The email thisIsAValidEmail@email.com is not in use.
            string email = "thisIsAValidEmail@email.com";

            bool isAvailable = userCtr.IsEmailAvailable(email);

            Assert.IsTrue(isAvailable, "Email is not in use");
        }
    }
}
